๐ 2๋จ๊ณ - ๋ฆฌํฉํฐ๋ง(๋ฉ๋ด)#372
๐ 2๋จ๊ณ - ๋ฆฌํฉํฐ๋ง(๋ฉ๋ด)#372AlbertImKr wants to merge 6 commits intonext-step:albertimkrfrom
Conversation
src/main/java/kitchenpos/menus/tobe/infra/RestTemplateProductClient.java
Outdated
Show resolved
Hide resolved
sah3122
left a comment
There was a problem hiding this comment.
๊ฐ์ธ์ ์ธ ์ฌ์ ์ผ๋ก ์ธํด ๋ณ์์ ์
์ํ๊ฒ ๋์ด ๋ฆฌ๋ทฐ๊ฐ ๋ฆ์ด์ก์ต๋๋ค ๐
๋ฉ๋ด ๋ฆฌํฉํฐ๋ง ๊ตฌํ ์ํด์ฃผ์
จ๋ค์ ๐
๋ช๊ฐ์ง ์๊ฐ๊ฑฐ๋ฆฌ๋ฅผ ๋จ๊ฒจ๋์๋๋ฐ ํ์ธ ๋ถํ๋๋ฆฝ๋๋ค!
| columnDefinition = "binary(16)", | ||
| foreignKey = @ForeignKey(name = "fk_menu_to_menu_group") | ||
| ) | ||
| private MenuGroup menuGroup; |
There was a problem hiding this comment.
MenuGroup์ ์ง์ ์ฐธ์กฐ๋ก ๊ตฌํํด์ฃผ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค ๐
There was a problem hiding this comment.
ํ Context์์ ์กด์ฌํ์ฌ ๋ง์ฝ์ Id๋ก ์ฐธ์กฐํ๋ฉด ์คํ๋ ค ๋ ๋ณต์กํ ๊ตฌ์กฐ๊ฐ ๋ ์ ์๋ค๊ณ ์๊ฐํ์ด์,
| return id; | ||
| } | ||
|
|
||
| public void changePrice(MenuPrice price) { |
There was a problem hiding this comment.
ํ์ฌ domain ๊ฐ์ฒด๊ฐ ๋ฉ๋ด ๊ฐ๊ฒฉ ๋ณ๊ฒฝ์ ๋ํ ์๊ตฌ์ฌํญ์ ํญ์ ๋ง์กฑํ ์์์๊น์ ?
domain ๊ฐ์ฒด๋ง์ผ๋ก ๋ชจ๋ ์๊ตฌ์ฌํญ์ ๋ง์กฑํ ์ ์๋๋ก ๊ตฌํํด๋ณด์ธ์ ๐
๋ค๋ฅธ ํ์๋ ํ์ธ ๋ถํ๋๋ฆฝ๋๋ค !
| private final MenuRepository menuRepository; | ||
| private final MenuGroupService menuGroupService; | ||
| private final PurgomalumClient purgomalumClient; | ||
| private final MenuProductService menuProductService; |
There was a problem hiding this comment.
Application Service ๊ฐ์ ๊ฒฐํฉ์ด ๋ฐ์ํ๋ฉด ์ด๋ค ๋ฌธ์ ์ ์ด ์์๊น์ ?
There was a problem hiding this comment.
์ ๊ฐ ์๊ฐํ๋ Application Service ๊ฐ์ ๊ฒฐํฉ์ด ๋ฐ์ํ ๋ ๋ํ๋ ์ ์๋ ๋ฌธ์ ์ ์ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
- ์ํ ์ฐธ์กฐ์ ๋ณต์ก์ฑ ์ฆ๊ฐ๊ฐ ์ฃผ์ ์ด์์ ๋๋ค.
- ํ์ง๋ง ์ ๋ MenuGroup์ด Menu์ ์ํ์ ๋๋ฉ์ธ์ด๊ธฐ ๋๋ฌธ์ ์ค์ ๋ก ํฐ ๋ฌธ์ ๊ฐ ๋ฐ์ํ์ง ์์ ๊ฒ์ด๋ผ๊ณ ํ๋จํ์ต๋๋ค.
- ๊ทธ๋ผ์๋ ๋ถ๊ตฌํ๊ณ ์๋น์ค ๊ฐ ์ฑ ์์ ๋ช ํํ ๋ถ๋ฆฌํ๊ธฐ ์ํด Facade ํจํด์ ์ ์ฉํ์ฌ ์๋น์ค์ ์ญํ ์ ๋ถ๋ฆฌํ์ต๋๋ค.
src/main/java/kitchenpos/menus/tobe/application/MenuService.java
Outdated
Show resolved
Hide resolved
| public Menu create(final MenuCreateRequest request) { | ||
| final MenuPrice price = new MenuPrice(request.price()); | ||
| final MenuGroup menuGroup = menuGroupService.findById(request.menuGroupId()); | ||
| final List<MenuProduct> menuProducts = menuProductService.getMenuProducts(price, request.menuProducts(), request.productIds()); |
There was a problem hiding this comment.
menuProductService ๋ฅผ ํตํ์ฌ menuproduct ๋ฅผ ๊ฐ์ง๊ณ ์จ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค !
There was a problem hiding this comment.
Menu Context ์์ฒด์์๋ Product๋ฅผ ์ง์ ์ฐธ์กฐํ์ง ์์ง๋ง Product ์ ๋ณด๋ฅผ ํ์ธํด์ผ ํ๋ ๊ฒฝ์ฐ๊ฐ ์์ต๋๋ค. ์ด๋ฅผ ์ํด ํ์ ๋๋ฉ์ธ์ธ MenuProduct์์ Product๋ฅผ ์กฐํํ๋๋ก ์ค๊ณํ์ต๋๋ค.
|
๋ฉํ ๋ ์ ์ง๋ด๊ณ ๊ณ์ ๊ฐ์? ํผ๋๋ฐฑ ์ ์ฉํ PR ๋ง์ด ๋ฆ์์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค. ๐ |
๋ฆฌ๋ทฐ์ด๋ ์๋ ํ์ธ์
2๋จ๊ณ ๋ฉ๋ด ๋ฆฌํฉํฐ๋ง ๊ณผ์ ์ ์ถํฉ๋๋ค.
๋ฆฌ๋ทฐ ์์ฒญ๋๋ฆฝ๋๋ค.
์ข์ ํ๋ฃจ ๋ณด๋ด์ธ์~